import { dataDef, propsDef, set, del } from '../../ather/index.js'
import Watcher from '../core/Watcher.js'
export default function(Vue) {
    Object.defineProperty(Vue.prototype, '$data', dataDef)
    Object.defineProperty(Vue.prototype, '$props', propsDef)
    Vue.prototype.$set = set
    Vue.prototype.$delete = del
    Vue.prototype.$watch = function(expOrFn, cb, options = {}) {
        const vm = this;
        const watcher = new Watcher(vm, expOrFn, cb, options)
        cb.call(vm, watcher.value)
        return function unwatchFn() {
            watcher.teardown()
        }
    }
}